//
//  PeachHelper.h
//  PeachDoctor
//
//  Created by ui on 2019/9/26.
//  Copyright © 2019 四川睡呗科技有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^TAsyncImageComplete)(NSString *path, UIImage *image);
//腾讯IM消息类型
typedef enum : NSUInteger {
    TIMMessageType_Invalid     =0,//无效的消息
    TIMMessageType_Text,//文本消息
    TIMMessageType_Image,//图片消息
    TIMMessageType_Sound,//声音消息
    TIMMessageType_Custom,//自定义消息 requestRtc system card_condition card_consult
    TIMMessageType_File,//文件消息
    TIMMessageType_Location,//地理位置消息
    TIMMessageType_Face,//图文消息
    TIMMessageType_Tips,//提示消息
    TIMMessageType_Video//短视频消息
} TIMMessageType;

typedef enum:NSUInteger{
    TIMBusinessType_houshi = 0,//风湿业务
    TIMBusinessType_inquiry,//问诊业务
    TIMBusinessType_medicine,//云药房业务
    TIMBusinessType_Patient,//病人端发送
    TIMBusinessType_Doctor,//医生端发送
}TIMBusinessType;


@interface THelper : NSObject

/**
 获取音频地址
 */
+ (NSString *)genVoiceName:(NSString *)uuid withExtension:(NSString *)extent;
/**
 获取视频地址
 */
+ (NSString *)genVideoName:(NSString *)uuid;

/// 音频格式转换
/// @param wavPath <#wavPath description#>
/// @param amrPath <#amrPath description#>
+ (BOOL)isAmr:(NSString *)path;
+ (BOOL)convertAmr:(NSString*)amrPath toWav:(NSString*)wavPath;
+ (BOOL)convertWav:(NSString*)wavPath toAmr:(NSString*)amrPath;
+ (NSString *)genSnapshotName:(NSString *)uuid;
+ (NSString *)genImageName:(NSString *)uuid;
+ (void)asyncDecodeImage:(NSString *)path complete:(TAsyncImageComplete)complete;
+ (NSDictionary *)jsonData2Dictionary:(NSData *)jsonData;
+ (NSData *)dictionary2JsonData:(NSDictionary *)dict;
+ (NSString *)localStringFromUTCDate:(NSDate *)UTCDate;
@end

NS_ASSUME_NONNULL_END
